package com.chejianer.push.service.impl;

import com.chejianer.push.utils.SocketThreadUtil;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * 监听servlet
 */
@Slf4j
public class ServletContextListenerImpl implements ServletContextListener{

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        log.info("servlet start");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        log.info("servlet destroyed");
        //关闭socketIOServer
        SocketThreadUtil.closeSocketIOServer();
    }

}
